﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Show : MonoBehaviour
{
    public void Awake()
    {
        gameObject.SetActive(false);
        EventCenter.AddListener<string>(EventType.ShowText, ShowText);
    }

    public void OnDestroy()
    {
        EventCenter.RemoveListener<string>(EventType.ShowText, ShowText);
    }

    public void ShowText(string s)
    {
        gameObject.SetActive(true);
        GetComponent<Text>().text = s;
    }

}
